package com.example.demoorder.bizservice.impl;

import com.alispring.cloud.demo.entity.User;
import com.example.demoorder.bizservice.TestBizService;
import com.example.demoorder.bizservice.feignservice.FeignService;
import com.example.demoorder.bizservice.http.OrderThirdService;
import com.example.demoorder.controller.TestCtl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class TestBizServiceImpl implements TestBizService {
    /**
     * log
     */
    Logger logger = LoggerFactory.getLogger(TestBizServiceImpl.class);
    @Autowired
    private FeignService feignService;
    @Value("${server.port}")
    private String p;
    @Autowired
    private OrderThirdService orderThirdService;

    public Map<String, Object> restFegin() {
        Map<String, Object> map = new HashMap();
        map.put("a", feignService.get());
        User user = feignService.getUser();
        logger.info(user.toString());
        map.put("b", user);
        map.put("order-port", p);
        String ss = orderThirdService.getBaiDuIndex();
        logger.info(ss.toString());
        return map;
    }
}
